package com.ssm.common.tool;


import java.util.Date;
import java.util.List;

/**
 * 说明：提供了对form表单中的数据验证的方法，主要用于首页面赛选查询条件
 * 
 */

public abstract class Validate {

	public static boolean isValidateString(String value){
		return value != null && !value.equals("") && !value.equals("0");
	}
	public static boolean isValidateString111(String value){
		return value != null && !value.equals("") && !value.equals("0")&& !value.equals("null");
	}
	public static boolean isValidateString1(String value){
		return value != null && !value.equals("") && !value.equals("null")&&!value.equals("undefined");
	}
	public static boolean isValidateLong(Long value){
		return value != null && value != 0;
	}
	
	public static boolean isValidateObject(Object value){
		return value != null;
	}
	
	public static boolean isValidateInteger(Integer value){
		return value != null && value != 0;
	}
	
	public static boolean isValidateDouble(Double value){
		return value != null && value != 0.0;
	}
	
	public static boolean isValidateDate(Date value){
		return value != null;
	}
	public static boolean isValidateList(List list){
		return list!=null&&list.size()>0;
	}
	public static String absolute(String value){
		String str ="";
		double a = Math.abs(Double.valueOf(value));
		if(a>0&&a<1){
			str = String.valueOf(Double.valueOf(value));
		}else{
			str = value;
		}
		return str;
	}
}